package cn.melon.window;

import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import cn.melon.mod.login.UserInfo;
import cn.melon.view.control.TestWindowController;

public class TmpWindow extends JFrame{
    
    private UserInfo userInfo;
    private ActionListener listener = new TestWindowController();
    
    public TmpWindow(UserInfo userInfo) {
        this.userInfo = userInfo;
        this.setTitle("请求测试窗口");
        createAndShowGUI();
        setSize(480, 320);
    }
    
    public void createAndShowGUI() {

        JPanel testPanel = new JPanel();
        testPanel.setLayout(new BoxLayout(testPanel, BoxLayout.Y_AXIS));

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton rollRequest = new JButton("学籍管理");
        JButton libRequest = new JButton("图书管理");
        JButton dormRequest = new JButton("宿舍管理");
        JButton storeRequest = new JButton("商店管理");
        JButton scRequest = new JButton("选课管理");
        
        rollRequest.addActionListener(listener);
        libRequest.addActionListener(listener);
        dormRequest.addActionListener(listener);
        storeRequest.addActionListener(listener);
        scRequest.addActionListener(listener);
        
        testPanel.add(rollRequest);
        testPanel.add(libRequest);
        testPanel.add(dormRequest);
        testPanel.add(storeRequest);
        testPanel.add(scRequest);
        
        this.add(testPanel);
        this.pack();
        this.setVisible(true);
    }
    
    public static void main(String[] args) {
        UserInfo userInfo = null;
        TmpWindow window = new TmpWindow(userInfo);
    }
}
